
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>${Inter.printOut('Courses',session.language)}</title>
    </head>
    <body>
        <div class="undernav">
          <%
          def a = session.access
          a.refresh()
          %>
          
            <span class="menuButton"><g:link class="createCourse" action="create">${Inter.printOut('New Course',session.language)}</g:link></span>
          
            <!-- This is the help button. -->
            <%  def help = Help.findByNameAndLanguage("course_list", session.language)
            def helplink = createLink(action:'show', controller:'help', id: help.id )%>
            <a href="#" onClick="MyWindow=window.open('${helplink}','Help','width=350,height=450'); return false;">${Inter.printOut('Help',session.language)}</a>
            <!-- This is the end of the help button. -->
        </div>
        <div class="body" style="width:98%">
            <h1>${Inter.printOut('Courses',session.language)}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table style="table-layout: fixed">
                    <thead>
                        <tr>
                   	        <g:sortableColumn property="activityId" title="${Inter.printOut('Course Code',session.language)}" />
                        
                   	        <g:sortableColumn property="name" title="${Inter.printOut('Name',session.language)}" />
                        
                   	        <g:sortableColumn property="description" title="${Inter.printOut('Description',session.language)}" />
                        
                   	        <g:sortableColumn property="level" title="${Inter.printOut('Level',session.language)}" />
                        
                                <g:sortableColumn property="Area" title="${Inter.printOut('Area',session.language)}" />
                   	    
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${courseInstanceList}" status="i" var="courseInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                            <td><g:link action="show" id="${courseInstance.id}">${fieldValue(bean:courseInstance, field:'activityId')}</g:link></td>
                        
                            <td><g:link action="show" id="${courseInstance.id}">${fieldValue(bean:courseInstance, field:'name')}</g:link></td>
                        
                            <td><g:link action="show" id="${courseInstance.id}">${fieldValue(bean:courseInstance, field:'description')}</g:link></td>
                        
                            <td><g:link action="show" id="${courseInstance.id}">${Inter.printOut(fieldValue(bean:courseInstance, field:'level'),session.language)}</g:link></td>
                        
                            <td><g:link action="show" id="${courseInstance.id}">${fieldValue(bean:courseInstance, field:'area')}</g:link></td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${courseInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
